home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
3_7.lha
/
3_7
/
3_7detst.c
< prev
next >
Wrap
Text File
|
1993-08-08
|
727b
|
46 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
include <stream.h>
ifdef TSTD
include "3_7d.c"
endif
ifdef TSTE
include "3_7e.c"
endif
oid* memcpy(void*, const void*, int);
har a[] = "abcdefghijklmnopqrstuvwxyz";
har b[3 * sizeof(a)];
har *x[] =
{
"",
"hello there",
"This is a test",
"The quick brown fox jumped over the lazy brown dog",
0
};
ain()
for (char **xp = x; *xp; xp++)
{
memcpy(b, a, sizeof a);
cout << "str='" << *xp << "'\n";
cout << "b=" << b << "\n";
ifdef TSTD
strcpy(b+3, *xp);
endif
ifdef TSTE
strncpy(b+3, sizeof(a)-3, *xp);
endif
cout << "b=" << b << "\n";
}
return 0;